package com.bbzn.device.client.service.emq.order.impl.mq;

import com.alibaba.fastjson.JSONObject;
import com.bbzn.device.client.constant.DeviceConstant;
import com.bbzn.device.client.dataobject.Device;
import com.bbzn.device.client.dataobject.SystemParam;
import com.bbzn.device.client.exception.DefinitException;
import com.bbzn.device.client.service.DeviceService;
import com.bbzn.device.client.service.SystemParamByCacheService;
import com.bbzn.device.client.utils.OptionalBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @Author wulongbo
 * @Date 2021/12/16 16:19
 * @Version 1.0
 */
@Component
public class MqSetSlotTypeImpl extends BaseMqSendImpl {

    @Autowired
    private SystemParamByCacheService systemParamByCacheService;

    @Autowired
    private DeviceService deviceService;

    @Override
    public String checkMap(String language) throws Exception {
        Device device = new Device();
        device.setImei(map.get("imei").toString());
        // 卡槽类型 【0：卡槽1（插拔卡）/ 1：卡槽2（贴片卡）】
        //emp中进行修改
        //device.setSlotType(reqVO.getSlotType());
        //卡槽设置状态【0：修改成功 / 1:修改中】
        device.setSlotState(1);
        //map.get("value"); //前端传了就有
        deviceService.updateByImeiSelective(device);
        return JSONObject.toJSONString(map);
    }
}
